Release 10.1A: OpenEdge Development:
Progress 4GL Handbook


Preface

This Preface contains the following sections:

Purpose

This book is a comprehensive tour of all the essential elements of the Progress 4GL. By the time you complete it, you will be competent to build thoroughly modern applications that take advantage of most of the language’s features. And you will use the language to build powerful business application logic, not just the toy demonstration windows you find in other language tutorials. Progress is not a toy. It’s a tool for serious developers who have serious business problems to solve.

There are a lot more specifics to many of the language statements, keywords, and options than this book covers. Therefore, you should always refer to the product documentation for more information. Where the language is concerned, you should refer to the OpenEdge Development: Progress 4GL Reference . This three-volume set has a complete description of all of the 4GL’s methods, attributes, and events in Volume I and an alphabetical listing of all the language keywords on Volumes II and III. Always look to it for more details on any topic covered in this book.

Audience

This book is written for two different kinds of audiences. The first group consists of existing Progress developers who might have created applications in earlier releases of the product, when many of the more recent extensions to the language were not yet available. These extensions include:

If you are already experienced in the 4GL, you will find some of the material, especially in the first couple of chapters, familiar. Feel free to skim through those sections quickly, but you should not skip even the first chapters altogether to avoid missing anything—there are changes and enhancements to the language at every level.

The second audience for this book consists of people completely new to Progress. The Progress 4GL remains by far the most powerful and comprehensive language for developing serious business applications. Combined with the Progress RDBMS™ database and the other components of the Progress OpenEdge™ product family, the Progress 4GL can support you in building and deploying your applications in ways that are matched by no other environment today. For those of you in this second group, you should take the time to learn enough about the language to understand some of the many ways it can help you in your development work. You probably need to have a background in some other programming language to catch on to Progress quickly, because the material might come at you fast and furious. Despite its many extraordinary and unique features, the Progress 4GL is basically a procedural programming language with most of the same constructs common to almost all such languages.

Organization

Chapter 1, "Introducing the Progress 4GL,"

Provides an introduction to the Progress 4GL, including an overview of its characteristics.

Chapter 2, "Using Basic 4GL Constructs,"

Describes the basics of writing Progress procedures.

Chapter 3, "Running Progress 4GL Procedures,"

Describes how you can work with and run different types of Progress 4GL procedures.

Chapter 4, "Introducing the OpenEdge AppBuilder,"

Introduces the AppBuilder's code generating features and pre-built components.

Chapter 5, "Examining the Code the AppBuilder Generates,"

Examines the underlying AppBuilder-generated code.

Chapter 6, "Procedure Blocks and Data Access,"

Describes how to integrate data-access logic into procedures using procedure blocks and scoping.

Chapter 7, "Record Buffers and Record Scope,"

Expands the discussion on integrating data-access logic into procedures with record buffers and record scope.

Chapter 8, "Defining Graphical Objects,"

Describes how to create visual objects for data display.

Chapter 9, "Using Graphical Objects in Your Interface,"

Describes how to add visual objects to a user interface procedure.

Chapter 10, "Using Queries,"

Describes how to implement field-level help and a complete online help system.

Chapter 10, "Using Queries,"

Describes how to define and use queries to pass result sets between application modules.

Chapter 11, "Defining and Using Temp-tables,"

Describes how to define and use temp-tables to pass result sets between application modules which is essential when creating distributed applications.

Chapter 12, "Using the Browse Object,"

Describes how to design and interact with static browse objects and the queries they represent.

Chapter 13, "Advanced Use of Procedures in Progress,"

Describes how to write and invoke procedures in addition to treating them as independent objects.

Chapter 14, "Defining Functions and Building Super Procedures,"

Describes how to create user-defined functions and build super procedures.

Chapter 15, "Handling Data and Locking Records,"

Describes data handling and record locks from the perspective of a distributed application.

Chapter 16, "Updating Your Database and Writing Triggers,"

Describes how to update your database and write triggers—topics you need to understand to build the business logic that is the heart of your application.

Chapter 17, "Managing Transactions,"

Describes how to manage database transactions.

Chapter 18, "Using Dynamic Graphical Objects,"

Describes how to add flexibility to your application by creating visual objects and defining their attributes programmatically at run time.

Chapter 19, "Using Dynamic Queries and Buffers,"

Describes how to create dynamic versions of data management objects such as queries and buffers.

Chapter 20, "Creating and Using Dynamic Temp-tables and Browses,"

Describes how to create dynamic versions of data management objects such as temp-tables and the browse.

Chapter 21, "Progress Programming Best Practices,"

Introduces additional language constructs and programming techniques to help you build the best-performing applications you can.

Typographical conventions

This manual uses the following typographical conventions:

Convention
Description
Bold
Bold typeface indicates commands or characters the user types, provides emphasis, or the names of user interface elements.
Italic
Italic typeface indicates the title of a document, or signifies new terms.
SMALL, BOLD CAPITAL LETTERS
Small, bold capital letters indicate OpenEdge® key functions and generic keyboard keys; for example, GET and CTRL.
KEY1+KEY2
A plus sign between key names indicates a simultaneous key sequence: you press and hold down the first key while pressing the second key. For example, CTRL+X.
KEY1 KEY2
A space between key names indicates a sequential key sequence: you press and release the first key, then press another key. For example, ESCAPE H.
Syntax:
Fixed width
A fixed-width font is used in syntax statements, code examples, system output, and filenames.
Fixed-width italics
Fixed-width italics indicate variables in syntax statements.
Fixed-width bold
Fixed-width bold indicates variables with special emphasis.
UPPERCASE 
fixed width 
Uppercase words are Progress® 4GL language keywords. Although these are always shown in uppercase, you can type them in either uppercase or lowercase in a procedure.
 
This icon (three arrows) introduces a multi-step procedure.
 
This icon (one arrow) introduces a single-step procedure.
Period (.)
or
colon (:)
All statements except DO, FOR, FUNCTION, PROCEDURE, and REPEAT end with a period. DO, FOR, FUNCTION, PROCEDURE, and REPEAT statements can end with either a period or a colon.
[ ]
Large brackets indicate the items within them are optional.
[ ]
Small brackets are part of the Progress 4GL language.
{ }
Large braces indicate the items within them are required. They are used to simplify complex syntax diagrams.
{ }
Small braces are part of the Progress 4GL language. For example, a called external procedure must use braces when referencing arguments passed by a calling procedure.
|
A vertical bar indicates a choice.
...
Ellipses indicate repetition: you can choose one or more of the preceding items.

Examples of syntax descriptions

In this example, ACCUM is a keyword, and aggregate and expression are variables:

Syntax
ACCUM aggregate expression  

FOR is one of the statements that can end with either a period or a colon, as in this example:

FOR EACH Customer: 
  DISPLAY Name. 
END. 

In this example, STREAM stream, UNLESS-HIDDEN, and NO-ERROR are optional:

Syntax
DISPLAY [ STREAM stream ] [ UNLESS-HIDDEN ] [ NO-ERROR ] 

In this example, the outer (small) brackets are part of the language, and the inner (large) brackets denote an optional item:

Syntax
INITIAL [ constant [ , constant ] ] 

A called external procedure must use braces when referencing compile-time arguments passed by a calling procedure, as shown in this example:

Syntax
{ &argument-name } 

In this example, EACH, FIRST, and LAST are optional, but you can choose only one of them:

Syntax
PRESELECT [ EACH | FIRST | LAST ] record-phrase 

In this example, you must include two expressions, and optionally you can include more. Multiple expressions are separated by commas:

Syntax
MAXIMUM ( expression , expression [ , expression ] ... ) 

In this example, you must specify MESSAGE and at least one expression or SKIP [ (n) ], and any number of additional expression or SKIP [ ( n ) ] is allowed:

Syntax
MESSAGE { expression | SKIP [ ( n ) ] } ... 

In this example, you must specify {include-file, then optionally any number of argument or &argument-name = "argument-value", and then terminate with }:

Syntax
{ include-file 
    [ argument | &argument-name = "argument-value" ] ... } 

Long syntax descriptions split across lines

Some syntax descriptions are too long to fit on one line. When syntax descriptions are split across multiple lines, groups of optional and groups of required items are kept together in the required order.

In this example, WITH is followed by six optional items:

Syntax
WITH [ ACCUM max-length ] [ expression DOWN ] 
  [ CENTERED ] [ n COLUMNS ] [ SIDE-LABELS ]
  [ STREAM-IO ] 

Complex syntax descriptions with both required and optional elements

Some syntax descriptions are too complex to distinguish required and optional elements by bracketing only the optional elements. For such syntax, the descriptions include both braces (for required elements) and brackets (for optional elements).

In this example, ASSIGN requires either one or more field entries or one record. Options available with field or record are grouped with braces and brackets:

Syntax
ASSIGN   { [ FRAME frame ] { field [ = expression ] }
            [ WHEN expression ] } ...
       | { record [ EXCEPT field ... ] } 

Example procedures

This manual provides numerous example procedures that illustrate syntax and concepts. You can access the example files and details for installing the examples from the following locations:

After you have installed the examples, you can find the samples for this book in the following location:

Doc_and_Samples_Install/src/prodoc/handbook 

OpenEdge messages

OpenEdge displays several types of messages to inform you of routine and unusual occurrences:

After displaying a message, OpenEdge proceeds in one of several ways:

OpenEdge messages end with a message number in parentheses. In this example, the message number is 200:

** Unknown table name table. (200) 

If you encounter an error that terminates OpenEdge, note the message number before restarting.

Obtaining more information about OpenEdge messages

In Windows platforms, use OpenEdge online help to obtain more information about OpenEdge messages. Many OpenEdge tools include the following Help menu options to provide information about messages:

On UNIX platforms, use the Progress pro command to start a single-user mode character OpenEdge client session and view a brief description of a message by providing its number.

To use the pro command to obtain a message description by message number:

  1. Start the Progress Procedure Editor:
  2. install-dir/dlc/bin/pro 
    

  3. Press F3 to access the menu bar, then choose Help Messages.
  4. Type the message number and press ENTER. Details about that message number appear.
  5. Press F4 to close the message, press F3 to access the Progress Procedure Editor menu, and choose File Exit.

Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095